#ifndef WF_MODIFYBEVEL_H
#define WF_MODIFYBEVEL_H

#include "pf_previewactioninterface.h"
#include "pf_modification.h"
#include "gui_export.h"

/**
 * This action class can handle user events to bevel corners.
 *
 */
class GUI_EXPORT WF_ModifyBevel : public PF_PreviewActionInterface {
	Q_OBJECT
public:
    /**
     * Action States.
     */
    enum Status {
        SetEntity1,      /**< Choosing the 1st entity. */
        SetEntity2,      /**< Choosing the 2nd entity. */
		SetLength1,      /**< Setting length 1 in command line. */
		SetLength2       /**< Setting length 2 in command line. */
		//SetTrim             /**< Setting trim flag in command line. */
    };

public:
    WF_ModifyBevel(PF_Container& container,
                        PF_GraphicView& graphicView);
    ~WF_ModifyBevel() {}
	
	static QAction* createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/);

	virtual LX_Define::ActionType rtti() {
		return LX_Define::ActionModifyBevel;
	}

    virtual void init(int status=0);
    virtual void trigger();

    virtual void mouseMoveEvent(PF_MouseEvent* e);
    virtual void mouseReleaseEvent(PF_MouseEvent* e);
	
    virtual void commandEvent(PF_CommandEvent* e);
	virtual PF_StringList getAvailableCommands();
	
    virtual void hideOptions();
    virtual void showOptions();
	
    virtual void updateMouseButtonHints();
    virtual void updateMouseCursor();
    virtual void updateToolBar();

	void setLength1(double l1) {
		data.length1 = l1;
	}

	double getLength1() {
		return data.length1;
	}
	
	void setLength2(double l2) {
		data.length2 = l2;
	}

	double getLength2() {
		return data.length2;
	}

	void setTrim(bool t) {
		data.trim = t;
	}

	bool isTrimOn() {
		return data.trim;
	}

private:
    PF_Entity* entity1;
	PF_Vector coord1;
    PF_Entity* entity2;
	PF_Vector coord2;
	PF_BevelAttribute data;
	/** Last status before entering angle. */
	Status lastStatus;
};

#endif
